package com.godGuang.consultation.controller;

import com.alibaba.fastjson2.JSONObject;
import com.godGuang.common.core.domain.Result;
import com.godGuang.common.core.utils.PageUtils;
import com.godGuang.common.core.utils.poi.ExcelUtil;
import com.godGuang.common.core.web.controller.BaseController;
import com.godGuang.common.core.web.page.TableDataInfo;
import com.godGuang.common.log.annotation.Log;
import com.godGuang.common.log.enums.BusinessType;
import com.godGuang.common.security.annotation.RequiresPermissions;
import com.godGuang.consultation.domain.Advisory;
import com.godGuang.consultation.domain.AdvisoryReq;
import com.godGuang.consultation.domain.Doctor;
import com.godGuang.consultation.service.AdvisoryService;
import com.godGuang.consultation.service.IDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * 问诊Controller
 *
 * @author godGuang
 * @date 2024-01-11
 */
@RestController
@RequestMapping("/advisory")
public class AdvisoryController extends BaseController
{
    @Autowired
    private AdvisoryService advisoryService;

    /**
     * 添加咨询
     * @param advisory
     * @return
     */
    @PostMapping("insertAdvisory")
    public Result insertAdvisory(@RequestBody Advisory advisory) {
        advisoryService.insertAdvisory(advisory);
        return Result.success();
    }

    /**
     * 修改咨询
     * @param advisory
     * @return
     */
    @PostMapping("updAdvisory")
    public Result updAdvisory(@RequestBody Advisory advisory) {
        advisoryService.updAdvisory(advisory);
        return Result.success();
    }
    /**
     * 评价详情
     * @param
     * @return
     */
    @PostMapping("list")
    public Result<List<Advisory>>  list(@RequestBody AdvisoryReq advisoryReq){
        List<Advisory> list = advisoryService.list(advisoryReq );
        return Result.success(list);
    }



}
